{% extends "base.html" %}
{% block content %}

<div class="alert alert-secondary"><h4>Submission complete!</h4>
    The following tasks were added successfully:
    {% for task in tasks %}
        <a href="{% url "submission_status" task %}">{{task}}</a>
    {% endfor %}.
    Click on the links to monitor the status of the submission.
</div>

{% if remote_console %}
    <div class="alert alert-secondary"><h4>Remote Control Session</h4>
        Tasks:
        {% for task in tasks %}
            <a href="{% url "remote_session" task %}">{{task}}</a>
        {% endfor %}.
        Click on the link to start an interactive remote session.
    </div>
{% endif %}

{% if existent_tasks %}
    {% for sha256, details in existent_tasks.items %}
        <div class="alert alert-secondary"><h4>Existent tasks for this hash: {{sha256}}!</h4>
            <ul>
                {% for block in details %}
                    <li>Task id: <a href="{% url "report" block.info.id %}"><span>{{block.info.id}}</span></a> {% if block.family  %} - Detection: <span style="color:#EE1B2F;">{{block.malfamily}}</span>{% endif %}</li>
                {% endfor %}
            </ul>
        </div>
    {% endfor %}
{% endif %}

{% if errors %}
    <div class="alert alert-danger"><h4>Submission Failed!</h4>
    <ul>
    {% for block in errors %}
        {% for k, v in block.items %}
            <li><b>{{k}}</b> - {{v}}</li>
        {% endfor %}
    {% endfor %}
    </ul>
    </div>
{% endif %}

{% endblock %}
